package com.example.administrator.yuejian23.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.yuejian23.Bean.AboutYuejian;
import com.example.administrator.yuejian23.Bean.MyCollect;
import com.example.administrator.yuejian23.Const;
import com.example.administrator.yuejian23.Fragment.viewholder.AboutYuejianViewHolder;
import com.example.administrator.yuejian23.R;
import com.squareup.picasso.Picasso;

import java.util.List;

/**
 * Created by Administrator on 2017/10/27.
 */

public class AboutYuejianAdapter extends RecyclerView.Adapter {
    private List<AboutYuejian> aboutYuejien;
    private Context context;
    private LayoutInflater layoutInflater;
    public AboutYuejianAdapter(Context context,List<AboutYuejian> aboutYuejien){
        this.context=context;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup,int viewType) {
        View itemView=LayoutInflater.from(context).inflate(R.layout.item_yuejian_about,viewGroup,false);
        AboutYuejianViewHolder holder=new AboutYuejianViewHolder(itemView);
        return holder;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
       AboutYuejianViewHolder aboutYuejianViewHolder= (AboutYuejianViewHolder) holder;
        AboutYuejian aboutYuejian=aboutYuejien.get(position);
        String corpname=aboutYuejian.getCorpname();
        String contact=aboutYuejian.getContact();
        String Image_logo= aboutYuejian.getLogo();
        Picasso.with(context).load(Image_logo).into(aboutYuejianViewHolder.Image_logo);
        aboutYuejianViewHolder.corpname.setText(corpname);
        aboutYuejianViewHolder.text_contact.setText(contact);
    }


    @Override
    public int getItemCount() {
        return aboutYuejien.size();
    }
}


